﻿function commentUp(cid)
{
	var xmlhttp;
	xmlhttp = new XMLHttpRequest();
	
	xmlhttp.onreadystatechange = function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		  document.getElementById(cid+"up").innerHTML = xmlhttp.responseText;
	}
	xmlhttp.open("GET","UpSupports.php?commentid="+cid,true);
	xmlhttp.send();
}

function commentDown(cid)
{
	var xmlhttp;
	xmlhttp = new XMLHttpRequest();
	
	xmlhttp.onreadystatechange = function()
	{
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
		  document.getElementById(cid+"down").innerText = xmlhttp.responseText;
	}
	xmlhttp.open("GET","DownSupports.php?commentid="+cid,true);
	xmlhttp.send();
}

function bookUp(bookname)
{
	var xmlhttp;
	var bk = encodeURI(bookname);
	xmlhttp = new XMLHttpRequest();
	xmlhttp.onreadystatechange = function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		  document.getElementById("bookup").innerHTML = xmlhttp.responseText;
	}
	xmlhttp.open("GET","UpSupports.php?bookname="+bk,true);
	xmlhttp.send();
}

function bookDown(bookname)
{
	var xmlhttp;
	var bk = encodeURI(bookname);
	xmlhttp = new XMLHttpRequest();
	
	xmlhttp.onreadystatechange = function()
	{
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
		  document.getElementById("bookdown").innerHTML = xmlhttp.responseText;
	}
	xmlhttp.open("GET","DownSupports.php?bookname="+bk,true);
	xmlhttp.send();
}